package com.xiangge.aliyun.aliyuntest.enums;

import jdk.nashorn.internal.objects.annotations.Getter;

import java.util.Arrays;

/**
 * @author lsy_server
 */
public enum ShippingEnum {
    ZTO(0, "中通快递", "ZTO"),
    YTO(1, "圆通速递", "YTO"),
    HTKY(2, "百世汇通", "HTKY"),
    YD(3, "韵达速递", "YD"),
    DBL(4, "德邦快递", "DBL");
    private Integer type;
    private String name;
    private String code;

    ShippingEnum(Integer type, String name, String code) {
        this.type = type;
        this.name = name;
        this.code = code;
    }

    public static ShippingEnum getByType(Integer type) {
        return Arrays.stream(ShippingEnum.values()).filter(o -> o.type.equals(type)).findFirst().orElse(null);
    }

    public Integer getType() {
        return type;
    }

    public String getName() {
        return name;
    }

    public String getCode() {
        return code;
    }
}
